<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_BOM操作</title>
</head>
<body>
<button onclick="alert('请先登录！')">弹出警告框</button>
<button onclick="confirm('确定删除？')">弹出确认框</button>
<script>
    //windows是浏览内置的全局对象，无需创建或导包，直接使用其属性与方法
    //ParseInt():将参数舍弃小数部分的方式转换为整数，如果得不到数字类型结果，会得到NaN
    console.log(parseInt(6.6));
    console.log(parseInt(6.1));
    console.log(parseInt(6));
    console.log(parseInt('6.6'));
    console.log(parseInt('hhhh'));

    //ParseFloat():将参数转换为小数，如果得不到字符类型结果，会得到NaN
    console.log(parseFloat(6.6));
    console.log(parseFloat(6.1));
    console.log(parseFloat(6));
    console.log(parseFloat('6.6'));
    console.log(parseFloat('hhhh'));

    //isNaN():判断参数是否为NaN,如果是NaN返回true,否则返回false
    console.log(isNaN(6.6));
    console.log(isNaN('hhh'));
    console.log(isNaN('6.6'));
</script>

</body>
</html>